QUICK START REFERENCE

version 1.1


1. Quick Start Config


1.1. Overview

This article introduces the config and use of quick start.


1.2. Start Up

  1. Quick boot skips uboot by default and starts the kernel directly.

  2. To enter uboot, long press the enter button and reboot.

  3. The post-start process is the execution stage of the profile after the system is running.


1.3. Build

  1. Find the corresponding ramfs config

    ./setup_config.sh configs/nvr/i2m/8.2.1/nor.glibc-ramfs.011a.64
    
  2. make image


1.4. Post-start Process

It includes the mounting of partitions and loading of modules, divided into two stages: init phase and demo phase

  • init parse:(refer to /etc/init.sh)

    The necessary environment config of the system:

    1. Load the necessary drivers for the system environment config

      Load kernel, misc, mi drivers in sequence.

    2. Run the app

      The demo needs to be run in the background and stored in dram.

  • demo parse:(refer to demo.sh)

    Perform other operations for the demo running

    1. Load the secondary drivers

      Load kernel, misc, mi drivers in sequence

    2. Run the demo

      Demo is stored in flash.


1.5. Module Loading Config

This section introduces the corresponding config files for module loading , which can be flexibly configured according to requirements.

  • init parse:

    1. Feature

      The module is stored in the ramfs partition, and it is stored in dram when the system is running (lib/modules/4.9.84).

    2. Config file storage directory

      The corresponding drive storage directory under project.

    3. Config file

      Used to configure the drivers loaded in each stage, and add the driver name to the corresponding file.

      1. kernel_mod_list:

        The kernel driver for system initialization, such as nls_utf8.ko.

      2. misc_mod_list

        The misc driver for system initialization, such as mhal.ko.

      3. mi_mod_list

        The mi driver for system initialization, such as mi_sys.ko.

    4. Use of config files

    Add the driver name to the corresponding config file.

  • demo parse:

    1. Feature

      The module is stored in the config partition (flash) and do not occupy memory (/config/modules/4.9.84)

    2. Config file storage directory

      project下相应驱动存放目录The corresponding drive storage directory under project.

    3. Config file

      Used to configure the drivers loaded in each stage, and add the driver name to the corresponding file.

      1. kernel_mod_list_late

        The kernel driver required when the demo is running, such as usb-storage.ko.

      2. misc_mod_list_late

        The misc driver required when the demo is running, such as fbdev.ko.

      3. mi_mod_list_late

        The mi driver required when the demo is running, such as mi_ai.ko.

    4. Use of config files

      Add the driver name to the corresponding config file.


The dynamic link library can be stored in the ramfs partition and the config partition. The ramfs partition occupies the memory, and the config partition is stored in the flash.

  • Stored in ramfs partition

    1. Config file name: lib_list_first

    2. Config file path:

      Dynamic link library directory, such as release/usbcam/i6/009A-fastboot/glibc/8.2.1/lib/dynamic

    3. Use

      Add the corresponding library name to the config file.

  • Stored in config partition

    1. Config file name: lib_list_second

    2. Config file path:

      Dynamic link library directory, such as release/usbcam/i6/009A-fastboot/glibc/8.2.1/lib/dynamic

    3. Use

      Add the corresponding library name to the config file.


1.7. Alkaid And Image Compilation Config

  • Alkaid compilation option configuration

    1. Config file path: image/configs/, such as configs/usbcam/i6/nor.glibc-ramfs.009a.64.qfn88

    2. Config items:

    Config items Description Example
    CHIP Chip type i6
    BOARD Board type 009A-fastboot
    BOARD_NAME Board name SSC009A-S01A
    PRODUCT Product type usbcam
    TOOLCHAIN Compilation tool type glibc
    TOOLCHAIN_VERSION Compilation tool version 8.2.1
    KERNEL_VERSION Linux kernel version 4.9.84
    LIBC libc library version libc-2.28
    BUSYBOX Specify busybox busybox-1.20.2-arm-linux-gnueabihf-glibc-8.2.1-dynamic
    IMAGE_CONFIG image config file IMAGE_CONFIG = nor.ramfs.hfglibc.nvr.mma
    CUSTOMER_OPTIONS Add SDK compilation environment null_options.mk
    CUSTOMER_TAILOR Enable/Disable the SDK compilation module usbcam_i6_tailor.mk
    MMAP Linux memory distribution config MMAP_I6_64.h
    MHAL mhal compilation option i6
    IQ0- IQ3 Required Iq file config imx307_iqfile.bin (ipc)
    EXBOOTARGS Expand bootargs option loglevel=0
    kernel$(BOOTENV) bootargs kernel startup config LX_MEM=$(KERNEL_MEMLEN) mma_heap=mma_heap_name0,miu=0,sz=0x2000000 mma_memblock_remove=1
    TOOLCHAIN_REL Toolchain prefix arm-linux-gnueabihf-
    SENSOR_LIST Sensor required for board imx291_MIPI.ko imx307_MIPI.ko sc4236_MIPI.ko SC4238_MIPI.ko
    SENSOR0 Default sensor imx307_MIPI.ko
    SENSOR0_OPT Sensor loading parameters chmap=1
    FLASH_SIZE Flash size 16M
  • Image compilation config

    1. Config file path: image/configs/

      image/configs/i6/nor.ramfs.hfglibc.nvr.mma
      
    2. Config items:

      Config items Description Example
      IMAGE_LIST Configure the bin file generated by image ipl uboot kernel rootfs nvrservice customer
      FLASH_TYPE Flash type nor
      BOOT_TYPE rootfs type fastboot
      PAT_TABLE flas interface type spi
      PHY_TEST Whether to test phy no
      ipl$(RESOUCE) ipl path $(PROJ_ROOT)/board/$(CHIP)/boot/ipl/fastboot/IPL.bin
      ipl_cust$(RESOUCE) ipl_cust path $(PROJ_ROOT)/board/$(CHIP)/boot/ipl/fastboot/IPL_CUST.bin
      uboot$(RESOUCE) uboot path $(PROJ_ROOT)/board/$(CHIP)/boot/$(FLASH_TYPE)/uboot/ u-boot.xz.img.bin
      kernel$(RESOUCE) kernel Image path $(PROJ_ROOT)/release/$(PRODUCT)/$(CHIP)/$(BOARD)/$(TOOLCHAIN) /$(TOOLCHAIN_VERSION)/bin/kernel/$(FLASH_TYPE)/uImage.mz
      kernel$(PATSIZE) Kernel partition size 0x200000
      kernel$(BOOTENV) Bootargs kernel parameter specification $(KERNEL_BOOT_ENV) loglevel=0
      kernel$(BOOTCMD) bootcmd kernel parameter specification sf read $(KERNELBOOTADDR) \$${sf_kernel_start} \$${sf_kernel_size}\;
      rootfs$(RESOUCE) rootfs output directory $(OUTPUTDIR)/rootfs
      rootfs$(FSTYPE) File system type used by rootfs ramfs
      rootfs$(PATSIZE) Partition size occupied by rootfs 0x400000
      rootfs$(BOOTENV) bootargs rootfs parameter specification rootfstype=ramfs initrd=$(INITRAMFSLOADADDR),$(rootfs$(PATSIZE))
      rootfs$(BOOTCMD) bootcmd rootfs parameter specification mxp r.info rootfs\; sf read $(INITRAMFSLOADADDR) \$${sf_part_start} \$${sf_part_size}\;
    3. User partition config

      Config items Description Example
      USR_MOUNT_BLOCKS Configure the required user partition (support configuring customers) nvrservice customer
      nvrservice$(RESOUCE) nvrservice partition directory $(OUTPUTDIR)/tvconfig/config
      nvrservice$(FSTYPE) nvrservice partition type squashfs
      nvrservice$(PATSIZE) nvrservice partition size 0x300000
      nvrservice$(MOUNTTG) nvrservice partition mount target /config
      nvrservice$(MOUNTPT) nvrservice partition mount point /dev/mtdblock3
      customer$(RESOUCE) customer partition directory $(OUTPUTDIR)/customer
      customer$(FSTYPE) customer partition type jffs2
      customer$(PATSIZE) customer partition size 0x6B0000
      customer$(MOUNTTG) customer partition mount target /customer
      customer$(MOUNTPT) customer partition mount point mtd:customer

2. Use Drive And Library


2.1. Overview

This chapter will introduce the required drivers and the use of some dynamic link libraries according to the required functions.


2.2. Classified By Driver

Classify Driver Note
usb basic driver usb-comon.ko usb basic driver
usb-core.ko usb host basic driver
ehci-hcd.ko usb2.0 host controller driver
xhci-hcd.ko usb3.0 host controller driver
usb usb-storage.ko usb driver (rely on usb basic driver)
mouse mousedev.ko mouse input driver
usbhid.ko usb mouse(rely on usb basic driver)
network adapter of_mdio.ko dependent file
kdrv_emac.ko Network adapter driver at the bottom of the platform
sstar_100_phy.ko
sunrpc.ko Remote Procedure Call(RPC) protocol for remote command execution, used by network file system (NFS).
libphy.ko Network basic drive
fixed_phy.ko
mtd device ubi.ko ubi driver
mmc card mmc_core.ko mmc basic driver
mmc_block.ko
kdrv_sdmmc.ko sd card driver
watchdog mdrv_wdt.ko watchdog driver
Font nls_utf8.ko utf8 font driver
hard disk drive (HDD) sd_mod.ko scsi interface disk support
libahci.ko Serial ata interface related driver
ahci_platform.ko
libahci_platform.ko
libata.ko
mdrv-sata-host.ko SATA low-level driver
iic mii.ko i2c driver
File system grace.ko, nfs.ko NFS
grace.ko, nfsv2.ko NFS(version2)
ubifs.ko ubi file system(flash)
jffs2.ko jffs2 file system(flash)
Squashfs Squashed read-only file system
fat.ko fat file system
vfat.ko vfat file system(USB)
cifs.ko cifs file system(samba)
ntfs.ko ntfs file system

2.3. Classified By Library

Classify Library Note
toolchain related library librt-2.28.so Real-time expansion library, including semaphore, synchronous io, etc.
libm-2.28.so Mathematics related library
ld-2.28.so Link library
libresolv-2.28.so Provide network domain name package analysis related functions
libdl-2.28.so Loading dynamics
libstdc++.so Standard library
libc-2.28.so
libpcprofile.so
libpthread-2.28.so Thread related library
MI related libmi_common.so mi basic library
libmi_sys.so mi basic library, responsible for building the basic mi framework and providing buf management
libmi_sensor.so sensor related library
libmi_vif.so vif related library
libmi_vpe.so vpe related library
libmi_venc.so Provide video decoding function
libmi_rgn.so Provide drawing function
libmi_disp.so Provide video splicing, video output, connect panel, hdmi and other functions.
libmi_vdec.so Provide video decoding function
libmi_vdf.so Provide video algorithm functions, including movement monitoring, occlusion detection, virtual fence, etc.
libmi_shadow.so Provide vdf connection interface
libmi_iqserver.so Provide network debugging iq function, connect isp module
libmi_ldc.so Provide fisheye lens restoration support
libmi_ive.so Provide the use of hardware operators
libmi_isp.so Provide advanced image debugging interface
libmi_ai.so audio input related library
libmi_ao.so audio output related library
libmi_gfx.so Provide data migration function
libmi_hdmi.so hdmi related library
libmi_panel.so panel related library
libmi_fb.so Provide fb device support
libmi_cipher.so Provide data encryption and decryption functions
others libcus3a.so Provide ISP advanced functions, such as auto focus
libMD_LINUX.so vdf related library, provide mobile monitoring function
libOD_LINUX.so vdf related library, provide occlusion detection function
libVG_LINUX.so vdf related library, provide virtual fence function
libAEC_LINUX.so audio algorithm library, providing aec function
libAED_LINUX.so audio algorithm library, providing babycry detection and high decibel detection
libAPC_LINUX.so audio algorithm library, providing noise reduction, equalization, automatic gain control, and high-pass filtering
libSRC_LINUX.so audio algorithm library, providing resampling function
libg711.so audio algorithm library, providing g711 encoding and decoding
libg726.so audio algorithm library, providing g726 encoding and decoding

Note: Toolchain related libraries are necessary. The mi libraries can be loaded as needed, and the others can be loaded according to the needs of the corresponding mi modules.